<?php
class Rss {
	public function get($sUrl) {
		$sXml = @file_get_contents ( $sUrl );
		if (! $sXml) {
			return false;
		}
		$oDom = @DOMDocument::loadXML ( $sXml );
		if (! $oDom) {
			return false;
		}
		$oData = $oDom->getElementsByTagName ( 'channel' );
		$oInfo = $oData->item ( 0 )->childNodes;
		foreach ( $oInfo as $oChild ) {
			if ($oChild->nodeName == 'item') {
				$aData ['item'] [] = $this->_getItem ( $oChild );
			} else {
				$aData ['info'] [$oChild->nodeName] = $oChild->nodeValue;
			}
		}
		return $aData;
	}
	
	private function _getItem($oItem) {
		$oChilds = $oItem->childNodes;
		foreach ( $oChilds as $oChild ) {
			$aInfo [$oChild->nodeName] = $oChild->nodeValue;
		}
		return $aInfo;
	}
}